package com.github.kezhenxu94.playground.java.newfeatures;

import org.junit.Test;

import java.io.BufferedReader;
import java.io.FileReader;

/**
 * Created by com.ikezhenxu.java.study on 4/11/15.
 */
public class TryWithResources {

	@Test
	public void tryWithOpenFile () {
		try ( BufferedReader reader = new BufferedReader (
				new FileReader ( "/Volumes/com.ikezhenxu.java.study/Developer/workspace/Java/AdvancedJVM/src/com.ikezhenxu.java.study/newfeatures/TryWithResources.java" ) ) ) {
			System.out.println ( reader.readLine () );
		} catch ( Exception e ) {
			e.printStackTrace ();
		}
	}
}
